// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;

body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	if (gf(80,12) == 4)
		sf(7,10,1);
	if (gf(80,12) >= 8)
		sf(7,10,2);
	
	if (gf(7,10) == 0) {
		}
	if (gf(7,10) == 1) {
		erase_char(718);
		erase_char(719);
		erase_char(720);
		spawn_creature(721);
		spawn_creature(722);
		activate_hidden_group(5);
		set_name(30005,"Haven Courtier");
		}
	if (gf(7,10) == 2) {
		erase_char(718);
		erase_char(719);

		spawn_creature(731);
		}
		
		
	sf(7,12,0);
	
	set_name(30001,"Haven Royal Guard");
	set_name(30002,"Haven Royal Guard");
	set_name(30003,"Royal Healer");

//	set_attack_range(,);

//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();

	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	//if ((set_ter1 == 0) && (gf(0,0) > 0)) {
	//	set_ter1 = 1;
	//	set_terrain(,,,);
	//	}
	
	if ((is_talking() == FALSE) && (is_town()) && (gf(7,17) == 3)) {
		sf(7,17,4);
		
		activate_hidden_group(10);
		set_name(733,"General Miranda");
		begin_talk_mode(26);
		}
	if ((is_talking() == FALSE) && (is_town()) && (gf(7,17) == 5)) {
		sf(7,17,6);
		relocate_char(random_group_member(0),52,36,1);
		set_view_center(52,36);
		spawn_creature(740);
		set_name(740,"Prince Sutter");
		begin_talk_mode(27);
		}
	// if (gf(,) == 0) {
	if (get_ran(1,0,100) < 24)
		give_char_text_bubble(724,"Zzz.");
	if (get_ran(1,0,100) < 24)
		give_char_text_bubble(724,"Zzzzz.");
	//	}

	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(720,"Come, child.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(720,"Report to me.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(720,"All is well.");
	if (get_ran(1,0,100) < 10)
		give_char_text_bubble(720,"I have instruction.");

	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	//if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
	//	last_abil = get_current_tick();
	//	}
break;

beginstate 10;
	sf(7,13,1);
break;

beginstate 11;
	if (gf(7,17) == 2)
		sf(7,17,3);
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
